package com.stormchaser.testproject.controllers;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.stormchaser.testproject.service.FleatsService;

@Controller
public class FleatsController {
	
	private static final Logger logger = LoggerFactory.getLogger(FleatsController.class);
	
	@Autowired
	private FleatsService fleatsService;
	
	@RequestMapping(value ="/fleats", method = RequestMethod.GET)
	public String list(Model model) {
		logger.info("Listing RATUC fleat");
		model.addAttribute("fleats", fleatsService.findAll());
		return "fleats/list";
	}
	
}